Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 4 - Geometric Operations / Geometric Operations Reference
Functions / Determining Whether One Shape Contains Another


GXContainsShape

You can use the GXContainsShape function to determine if the area covered by a shape contains the area covered by another shape.

gxBoolean GXContainsShape(gxShape container, gxShape test);
container
A reference to the shape to test as the container.
test
A reference to the shape to test for inclusion.
function result
A Boolean value indicating whether the container shape contains
the test shape.
DESCRIPTION
The GXContainsShape function returns true as its function result if the shape specified by the container parameter contains the shape specified by the test parameter, and returns false otherwise.

This function may return true even if the container shape and the test shape share one or more edges; it returns true if they are the same shape.

This function considers the shape fill, the style modifications, and the transform mapping of the container and test shapes. Only areas that are drawn are considered when determining whether the container shape contains the test shape.

The container shape must have one of the solid shape fills (even-odd, winding, inverse even-odd, or inverse winding). The test shape may have any shape fill.

If the test shape has a framed shape fill, this function returns true if the frame lies entirely within the area of the container shape, or along the edges of the container shape. As a result, a solid shape contains its own frame.

If you provide a test shape that is not one of the geometric shape types, this function performs the actions described in the following table:
Shape typeAction taken
bitmapCompares bounding rectangle of bitmap
picturePosts the error illegal_type_for_shape
textConverts to path shape
glyphConverts to path shape
layoutConverts to path shape

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
illegal_type_for_shape(debugging version)
shape_operator_may_not_be_a_picture(debugging version)
SEE ALSO
For examples using this function, see "Determining Whether One Shape Contains Another" beginning on page 4-58.

For a discussion of shape fills, see Chapter 2, "Geometric Shapes," in this book.

For a discussion of style modifications, see Chapter 3, "Geometric Styles," in this book.

For a discussion of transform mappings, see the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.

To determine if a rectangle contains a shape, use the GXContainsBoundsShape function, described on page 4-101.

To determine if one shape touches another, use the GXTouchesShape function, described on page 4-98.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help